<template>
	<view class="hot-sell">
		<view class="hot-sell-text">
			热卖推荐
		</view>
		<view class="hot-sell-item" >
			<view class="sell-item" v-for="(item,index) in hotSellData" :key = "index" @click="detailRoute(item.pid)">
				<view class="hot">hot</view>
				<view class="item-top"><image :src="item.largeImg" mode=""></image></view>
				<view class="item-middle">{{item.name}}</view>
				<view class="item-middle-en">{{item.enname}}</view>
				<view class="item-bottom">￥{{item.price}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		props:{
			hotSellData:Array
		},
		data() {
			return {
			}
		},
		methods:{
			detailRoute(e){
				uni.navigateTo({
					url:`../detail/Detail?pid=${e}`,
				})
			}
		}
	}
</script>

<style scoped>
	.hot-sell{
		margin-top: 40rpx;
		z-index: 1;
	}
	.hot-sell-text{
		width: 180rpx;
		height: 75rpx;
		font-size: 17rpx;
		color: #FFFFFF;
		background-color: #0c34ba;
		border: 2rpx solid #FFFFFF;
		border-radius: 0% 30% 0% 0%;
		text-align: center;
		line-height: 75rpx;
	}
	.hot-sell-item{
		margin: 30rpx;
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
	}
	.sell-item{
		width: 48%;
		position: relative;
		border-radius: 20rpx;
		padding: 20rpx;
		box-sizing: border-box;
		background-color: #fff;
		margin-bottom: 30rpx;
	}
	.hot{
		position: absolute;
		color: #FFFFFF;
		background-color: #0C34BA;
		width: 60rpx;
		height: 60rpx;
		border-radius: 10rpx;
		top: 20rpx;
		left: 40rpx;
		text-align: center;
		line-height: 60rpx;
		z-index: 99;
	}
	.item-top{
		width: 100%;
		height: 250rpx;
	}
	.item-top>image{
		width: 100%;
		border-radius: 20rpx;
		height: 100%;
	}
	.item-middle{
		margin-top: 10rpx;
		font-size: 38rpx;
		color: black;
	}
	.item-middle-en{
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
		color:  #b7b8b8;
		margin-top: 5rpx;
	}
	.item-bottom{
		color: #0C34BA;
		font-weight: bold;
		margin-top: 10rpx;
		
	}
</style>
